package me.tonywang.aop;

import org.springframework.aop.framework.ProxyFactory;

/**
 * Created by Administrator on 2017/11/3.
 */
public class SpringAop {

    public static void main(String[] args) {
        ProxyFactory weaver = new ProxyFactory();
        weaver.addInterface(TestInterface.class);
        weaver.setTarget(new TestImpl());
        weaver.addAdvice(new WatchMethodInterceptor());
        TestInterface it = TestInterface.class.cast(weaver.getProxy());
        it.doSth();
    }


}
